<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <!-- 通过createElement 创建一个table表格； -->
    <table></table>
    <script>
      var tab = document.querySelector("table");
      //console.log(tab);
      for (j = 1; j < 5; j++) {
        var h = document.createElement("tr");
        for (i = 0; i < 5; i++) {
          var t = document.createElement("td");
          t.innerHTML = `${i}${i}${i}`;
          //   h.innerHTML = `${j}${j}${j}`;
          h.appendChild(t);
        }
        tab.appendChild(h);
      }
      document.body.appendChild(tab);
    </script>
  </body>
</html>
